package com.ruoyi.ora.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.ora.mapper.AssetsCommentMapper;
import com.ruoyi.ora.domain.AssetsComment;
import com.ruoyi.ora.service.IAssetsCommentService;

/**
 * 评论Service业务层处理
 * 
 * @author liuwp
 * @date 2025-04-10
 */
@Service
public class AssetsCommentServiceImpl implements IAssetsCommentService 
{
    @Autowired
    private AssetsCommentMapper assetsCommentMapper;

    /**
     * 查询评论
     * 
     * @param id 评论主键
     * @return 评论
     */
    @Override
    public AssetsComment selectAssetsCommentById(Long id)
    {
        return assetsCommentMapper.selectAssetsCommentById(id);
    }

    /**
     * 查询评论列表
     * 
     * @param assetsComment 评论
     * @return 评论
     */
    @Override
    public List<AssetsComment> selectAssetsCommentList(AssetsComment assetsComment)
    {
        return assetsCommentMapper.selectAssetsCommentList(assetsComment);
    }

    /**
     * 根据业务主键查询一条记录：评论
     *
     * @param assetsComment 评论
     * @return 评论
     */
    @Override
    public AssetsComment selectOneAssetsComment(AssetsComment assetsComment)
    {
        return assetsCommentMapper.selectOneAssetsComment(assetsComment);
    }

    /**
     * 新增评论
     * 
     * @param assetsComment 评论
     * @return 结果
     */
    @Override
    public int insertAssetsComment(AssetsComment assetsComment)
    {
        assetsComment.setCreateTime(DateUtils.getNowDate());
        return assetsCommentMapper.insertAssetsComment(assetsComment);
    }

    /**
     * 修改评论
     * 
     * @param assetsComment 评论
     * @return 结果
     */
    @Override
    public int updateAssetsComment(AssetsComment assetsComment)
    {
        return assetsCommentMapper.updateAssetsComment(assetsComment);
    }

    @Override
    public int updateAssetsCommentCondition(AssetsComment assetsComment, AssetsComment assetsCommentCondition)
    {
        return assetsCommentMapper.updateAssetsCommentCondition(assetsComment, assetsCommentCondition);
    }

    /**
     * 批量删除评论
     * 
     * @param ids 需要删除的评论主键
     * @return 结果
     */
    @Override
    public int deleteAssetsCommentByIds(Long[] ids)
    {
        return assetsCommentMapper.deleteAssetsCommentByIds(ids);
    }

    /**
     * 删除评论信息
     * 
     * @param id 评论主键
     * @return 结果
     */
    @Override
    public int deleteAssetsCommentById(Long id)
    {
        return assetsCommentMapper.deleteAssetsCommentById(id);
    }

    /**
     * 条件删除评论
     *
     * @param assetsComment 评论
     * @return 结果
     */
    @Override
    public int deleteAssetsCommentByCondition(AssetsComment assetsComment)
    {
        return assetsCommentMapper.deleteAssetsCommentByCondition(assetsComment);
    }

}
